print image python

43

show image in python -

from PIL import Image

#read the image
im = Image.open("sample-image.png")

#show image
im.show()

print image python -

import matplotlib.pyplot as plt
import matplotlib.image as mpimg
img = mpimg.imread('your_image.png')
imgplot = plt.imshow(img)
plt.show()

Comments

Submit
0 Comments